package com.company;

import javax.imageio.ImageIO;
import java.util.Random;

/**
 * Created by v on 17-7-9.
 */
public class Bee extends Flyer{
    private static int XSpeed=1;
    private static int YSpeed=2;

    private int reward;

    public static final int DOUBLEFIRE=0;
    public static final int LIFE=1;

    public Bee(int x,int y){
        this.x=x;
        this.y=y;
        image= Image.bee;
        width=image.getWidth();
        height=image.getHeight();

        //生成奖励
        Random random=new Random();
        reward=random.nextInt(2);
    }

    @Override
    public boolean outOfBound() {
        return y>Main.HEIGHT;
    }

    @Override
    public void step() {
        if(x+width>Main.WIDTH){
            XSpeed=-1;
        }

        x+=XSpeed;
        y+=YSpeed;
    }

    public int getReward() {
        return reward;
    }
}
